﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.ServiceModel.DomainServices.Tools;
using Microsoft.ServiceModel.DomainServices.Tools.TextTemplate;
using Microsoft.ServiceModel.DomainServices.Tools.TextTemplate.CSharpGenerators;

namespace InsuranceAdjuster.Web.OccasionallyConnected
{
    [DomainServiceClientCodeGenerator(typeof(OccasionallyConnectedClientCodeGenerator), "C#")]
    public class OccasionallyConnectedClientCodeGenerator : CSharpClientCodeGenerator
    {
        protected override EntityGenerator EntityGenerator
        {
            get
            {
                return new OccasionallyConnectedEntityGenerator();
            }
        }

    }

    public class OccasionallyConnectedEntityGenerator : CSharpEntityGenerator
    {
        public override string TransformText()
        {
            //return base.TransformText().Replace(" : System.ServiceModel.DomainServices.Client.Entity", " : InsuranceAdjuster.OccasionallyConnected.EntityBase");
            return base.TransformText().Replace(" : System.ServiceModel.DomainServices.Client.Entity", " : System.ServiceModel.DomainServices.Client.Entity, InsuranceAdjuster.OccasionallyConnected.IEntity")
                //                           .Replace("", "");
            ;
        }
    }
}